import React, { useContext, useEffect } from "react";
import './test-b.component.css';
import { GLOBAL } from "../../../app.component";
import { Topic } from "../../../rx/topic";

const TestBComponent: React.FC = () => {

	const global = useContext(GLOBAL);

	return (
		<div className="container-test-b">
			<div className="name-test-b">
				test-b component
			</div>
			<button className="send-btn" onClick={() => {
				global.innerMqService.pub(Topic.MY_TP_1, '来自test-b的消息');
			}}>
				发送
			</button>
		</div>
	);
}

export default TestBComponent;
